package com.lczyfz.campusinfo.modules.cms.web;


import com.lczyfz.campusinfo.modules.cms.dao.CampusinfoAboutUsDao;
import com.lczyfz.campusinfo.modules.cms.entity.CampusinfoAboutUs;
import com.lczyfz.campusinfo.modules.cms.service.CampusinfoAboutUsService;
import com.lczyfz.campusinfo.modules.user.utils.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "${frontPath}/cms/aboutus/")
public class CampusinfoApiAboutUsController {

    @Autowired
    private CampusinfoAboutUsService campusinfoAboutUsService;

    @ResponseBody
    @RequestMapping(value = "get_aboutus_info",method = RequestMethod.POST)
    public ServerResponse<CampusinfoAboutUs> getAboutUsInfo(){
        CampusinfoAboutUs campusinfoAboutUs = campusinfoAboutUsService.get("1");
        if(campusinfoAboutUs != null){
            return ServerResponse.createBySuccess("成功获取关于我们信息",campusinfoAboutUs);
        }
        return ServerResponse.createByErrorMessage("获取关于我们信息失败");
    }

}
